package br.com.salao.rest;

import java.util.List;
import javassist.NotFoundException;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;

import br.com.salao.bean.Pais;
import br.com.salao.model.PaisModel;


@Path("/pais")
public class PaisService {
	
	@GET
	@Path("/listar")	
	@Produces({MediaType.APPLICATION_JSON})
	public List<Pais> listarPaises() throws NotFoundException{
		
		PaisModel model = new PaisModel();
		List<Pais> listPaises = model.listarPaises();	
		
		if(listPaises == null){
			throw new NotFoundException("Paises nao encontrados");
		}
	
		return listPaises;
	}

}
